setwd("C://Users//gabri//Desktop//base de dados artigo revisão")
getwd()
devtools::install_github("massimoaria/pubmedR")
#install.packages("pubmedR", force=TRUE)
install.packages("rio")

devtools::install_github("massimoaria/bibliometrix")
install.packages("bibliometrix", dependencies=TRUE)
install.packages("jsonlite", type="source")

#Carregue as library abaixo:
library(pubmedR)
library(bibliometrix)

#setwd("C:\\Users\\Tiago\\Documents\\ProjetoGestaoClimatica")
A=convert2df("scopus.bib", dbsource ='scopus', format="bibtex")
B=convert2df("scopus_1.bib", dbsource ='scopus', format="bibtex")
M=mergeDbSources(A,B, remove.duplicated = TRUE)

#rio::export(M,file="C:\\Users\\Tiago\\Documents\\ProjetoGestaoClimatica\\M.xlsx")

dir()

A1=convert2df("savedrecs.bib", dbsource ='isi', format="bibtex")
B1=convert2df("savedrecs (1).bib", dbsource ='isi', format="bibtex")
C1=convert2df("savedrecs (2).bib", dbsource ='isi', format="bibtex")
D1=convert2df("savedrecs (3).bib", dbsource ='isi', format="bibtex")
E1=convert2df("savedrecs (4).bib", dbsource ='isi', format="bibtex")
F1=convert2df("savedrecs (5).bib", dbsource ='isi', format="bibtex")
G1=convert2df("savedrecs (6).bib", dbsource ='isi', format="bibtex")
H1=convert2df("savedrecs (7).bib", dbsource ='isi', format="bibtex")
I1=convert2df("savedrecs (8).bib", dbsource ='isi', format="bibtex")
J1=convert2df("savedrecs (9).bib", dbsource ='isi', format="bibtex")
L1=convert2df("savedrecs (10).bib", dbsource ='isi', format="bibtex")

M1=mergeDbSources(A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,L1, remove.duplicated = TRUE)
#rio::export(M1,file="C:\\Users\\Tiago\\Documents\\ProjetoGestaoClimatica\\M1.xlsx")

Mscopus_WOS=mergeDbSources(M,M1, remove.duplicated = TRUE)
#rio::export(Mscopus_WOS,file="C:\\Users\\Tiago\\Documents\\ProjetoGestaoClimatica\\Mscopus_wos.csv")

#rio::export(M,file="C:\\Users\\Tiago\\Documents\\ProjetoGestaoClimatica\\Mteste.xlsx")
names(M)
M = M %>%  rename("abstract" = "AB")
M$AB


Mscopus_WOS%>%dplyr::select(AU, DE, TI, AB)->Mscopus_WOS_filter
Mscopus_WOS_filter = Mscopus_WOS_filter %>%  rename("abstract" = "AB", "author"="AU","Keywords"="DE","title"="TI")
rio::export(Mscopus_WOS_filter,file="C:\\Users\\Tiago\\Documents\\ProjetoGestaoClimatica\\Mscopus_WOS_filter.xlsx")

library(dplyr)
setwd("C:\\Users\\Tiago\\Documents\\ProjetoGestaoClimatica")
dados=read_xlsx("resultados_aesreview.xlsx")
Mscopus_WOS=read_xlsx("Mscopus_wos.xlsx")
Mscopus_WOS$record_id=seq(1:12489)
df=left_join(Mscopus_WOS, dados, by="record_id")
df=df[,-c(1,2,7,23)]
#rio::export(df,file="C:\\Users\\Tiago\\Documents\\ProjetoGestaoClimatica\\base_bilio.xlsx")



###########



biblioshiny()
